package com.wangfei.test.filehandler;


import java.util.regex.Pattern;

public enum StrEnum {
    /**
     * project id
     */
    NUMERICVAL("UOS000000", 0),
    /**
     * chinese date
     */
    DATEVAL("11月10日", 1),
    /**
     * numeric date
     */
    DATENUMERICVAL("20201110", 2),
    /**
     * model模块
     */
    MOUDLEVAL("查看模块(wangdafe、fda)是否", 3),
    /**
     * model模块
     */
    IPADDRESS("10.22.21.5/6/132/133", 5);



    private String value;
    private int index;

    private StrEnum(String value, int index){
        this.value = value;
        this.index = index;
    }

    public static int getIndex(String value) {
        for(StrEnum t : StrEnum.values()){
            if(value.equals(t.getValue())) {
                return t.index;
            }
        }
        return -1;
    }

    public int getIndex(){
        return index;
    }

    public String getValue(){
        return value;
    }

    public static Pattern getPattern(String value){
        return Pattern.compile(value);
    }
}
